public class ArrayList4 {
    public class User {
        private String id;
        private String username;
        private String password;

        public User {
        }

        public User(String id, String username, String password) {
            this.id = id;
            this.username = username;
            this.password = password;
        }

        public String getid() {
            return id;
        }

        public void setid(String id) {
            this.id = id;
        }

        public String getusername() {
            return username;
        }

        public void setusername(String username) {
            this.username = username;
        }

        public String getpassword() {
            return username;
        }

        public void setpassword(String password) {
            this.password = password;
        }

    }

    public static void main(String[] args) {
        ArrayList<User> list = new ArrayList();
        User u1 = new User("001", "zhangshan", "123456");
        User u2 = new User("002", "lisi", "123457");
        User u3 = new User("003", "wangwu", "123458");
        list.add(s1);
        list.add(s2);
        list.add(s3);
        bool flag = contains(list, 001);
        System.out.println(flag);

    }

    public static boolean contains(ArrayList<User> list, String id) {
        for (int i = 0; i < list.size(); i++) {
            User u = list.get(i);
            String uid = u.getid();
            if (uid.equals(id)) {
                return ture;
            }
        }
        return false;
    }

}
